package com.isoftstone.bank.controller;


import com.isoftstone.bank.controller.base.BaseController;
import com.isoftstone.bank.entity.BOperator;
import com.isoftstone.bank.service.IOperatorService;
import com.isoftstone.common.Page;
import com.isoftstone.util.PageData;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * Created by WLJ on 2017/11/28.
 */
@Controller
public class OperatorController extends BaseController {

    @Autowired
    IOperatorService operatorService;

    /**
     *进入银行用户页面
     * @param page
     * @return
     */
    @RequestMapping("/bank/operator")
    public ModelAndView toOperatorPage(Page page){
        ModelAndView md = new ModelAndView();
        PageData pd = this.getPageData();

        List<BOperator> operatorList = operatorService.getOperatorlistPage(page);

        md.addObject("operatorList",operatorList);

        md.setViewName("/system/bank/operator/operator_list");
        return md;
    }


    /**
     ModelAndView md = new ModelAndView();
     PageData pd = this.getPageData();
     try {
     String keywords = pd.getString("keywords");
     if( keywords != null){
     String keywords1 = URLDecoder.decode(keywords,"UTF-8");
     pd.put("keywords",keywords1);
     }
     page.setPd(pd);
     //SysUser user = this.getUser();
     List<SysUser> userList = sysUserService.getUserlistPage(page);
     //System.out.println(userList);
     md.addObject("userList", userList);
     } catch (Exception e) {
     e.printStackTrace();
     }
     md.setViewName("sysuser/user/user_list");
     return md;
     *
     */

}
